let arr = [[], 123, true, {name:1}]
console.log(arr.join(''));
Array.prototype.myjoin = function(flag) {
    let s = this[0].toString()
    for(let i = 1; i < this.length; i++) {
        if(this[i] instanceof Object) {
            s = s + flag + this[i].toString()
        }
        else {
            
            s =s + flag + this[i]
        }
    }
    return s
}

console.log(arr.myjoin(' '));
